From 47e6aca1cdba122ecb3898538372d44c89e4c8ab Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Wed, 8 Mar 2023 12:43:11 -0500 Subject: [PATCH] Cherry-pick patch to fix combo boxes --- ...-build-Drop-the-install-tests-option.patch | 22 ++++---- .../combobox-Avoid-extra-queue_resize.patch | 56 +++++++++++++++++++ .../debian/Disable-clipboard-test.patch | 2 +- ...isable-inscription-markup.ui-reftest.patch | 4 +- debian/patches/series | 1 + 5 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 debian/patches/combobox-Avoid-extra-queue_resize.patch diff --git a/debian/patches/Revert-build-Drop-the-install-tests-option.patch b/debian/patches/Revert-build-Drop-the-install-tests-option.patch index 82d579e833..5b9b257c3f 100644 --- a/debian/patches/Revert-build-Drop-the-install-tests-option.patch +++ b/debian/patches/Revert-build-Drop-the-install-tests-option.patch @@ -22,10 +22,10 @@ This reverts commit 3121f88265ac61733e257f5335473d6f139f158c. 12 files changed, 353 insertions(+), 43 deletions(-) diff --git a/meson.build b/meson.build -index 28fb2ec..b003248 100644 +index ffcfd8a..bf03545 100644 --- a/meson.build +++ b/meson.build -@@ -888,6 +888,7 @@ summary('Introspection', build_gir, section: 'Build') +@@ -889,6 +889,7 @@ summary('Introspection', build_gir, section: 'Build') summary('Documentation', get_option('gtk_doc'), section: 'Build') summary('Man pages', get_option('man-pages'), section: 'Build') summary('Tests', get_option('build-tests'), section: 'Build') @@ -34,10 +34,10 @@ index 28fb2ec..b003248 100644 summary('Examples', get_option('build-examples'), section: 'Build') diff --git a/meson_options.txt b/meson_options.txt -index 5fd4125..2e43a17 100644 +index 9f608e9..5e16043 100644 --- a/meson_options.txt +++ b/meson_options.txt -@@ -128,3 +128,8 @@ option('build-tests', +@@ -133,3 +133,8 @@ option('build-tests', type: 'boolean', value: true, description : 'Build tests') @@ -404,7 +404,7 @@ index ef703d7..3228049 100644 + install_data(test_data, install_dir: testexecdir) +endif diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build -index f3d3a1b..3236ce7 100644 +index ebaa66f..98b57cb 100644 --- a/testsuite/gdk/meson.build +++ b/testsuite/gdk/meson.build @@ -1,10 +1,13 @@ @@ -427,7 +427,7 @@ index f3d3a1b..3236ce7 100644 tests = [ { 'name': 'array' }, -@@ -32,7 +35,8 @@ foreach t : tests +@@ -31,7 +34,8 @@ foreach t : tests sources: '@0@.c'.format(test_name), c_args: common_cflags, dependencies: libgtk_dep, @@ -437,7 +437,7 @@ index f3d3a1b..3236ce7 100644 ) suites = ['gdk'] + t.get('suites', []) -@@ -59,7 +63,8 @@ foreach t : internal_tests +@@ -58,7 +62,8 @@ foreach t : internal_tests test_exe = executable(t, '@0@.c'.format(t), c_args: common_cflags, dependencies: libgtk_static_dep, @@ -447,7 +447,7 @@ index f3d3a1b..3236ce7 100644 ) test(t, test_exe, -@@ -73,3 +78,28 @@ foreach t : internal_tests +@@ -72,3 +77,28 @@ foreach t : internal_tests suite: 'gdk', ) endforeach @@ -477,7 +477,7 @@ index f3d3a1b..3236ce7 100644 + install_subdir('image-data', install_dir: testexecdir) +endif diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build -index 1897562..67514eb 100644 +index f52a770..872897c 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -1,12 +1,22 @@ @@ -505,7 +505,7 @@ index 1897562..67514eb 100644 ) compare_render_tests = [ -@@ -256,9 +266,11 @@ foreach t : tests +@@ -266,9 +276,11 @@ foreach t : tests test_extra_ldflags = t.get(3, []) test_exe = executable(test_name, test_srcs, @@ -518,7 +518,7 @@ index 1897562..67514eb 100644 ) test(test_name, test_exe, -@@ -287,11 +299,12 @@ foreach t : internal_tests +@@ -297,11 +309,12 @@ foreach t : internal_tests test_extra_cargs = t.get(2, []) test_extra_ldflags = t.get(3, []) diff --git a/debian/patches/combobox-Avoid-extra-queue_resize.patch b/debian/patches/combobox-Avoid-extra-queue_resize.patch new file mode 100644 index 0000000000..a3a8e6a928 --- /dev/null +++ b/debian/patches/combobox-Avoid-extra-queue_resize.patch @@ -0,0 +1,56 @@ +From: Ivan Molodetskikh +Date: Tue, 7 Mar 2023 09:51:32 -0800 +Subject: combobox: Avoid extra queue_resize() + +width-request already ensures it's above the minimum width, so avoid an +extra queue_resize() when setting size request to (-1, -1). + +This is the same way as GtkDropDown works. This also unbreaks +GtkComboBox after the recent allocation fix in +75a417e33708dab2bdb2f784a8952e085a12bf03. + +Incidentally, this also makes GtkComboBox actually resize its popup as +intended (that was broken before). + +I don't think this is ultimately the final fix, sometimes I still get +allocation warnings. But the proper fix will probably involve changing +some more allocation machinery around popovers. This is good enough for +now. + +(cherry picked from commit 55faea104694599298a6ca1b9f2e7a1b46bad45a) +--- + gtk/deprecated/gtkcombobox.c | 14 ++------------ + 1 file changed, 2 insertions(+), 12 deletions(-) + +diff --git a/gtk/deprecated/gtkcombobox.c b/gtk/deprecated/gtkcombobox.c +index 618f078..1e76b38 100644 +--- a/gtk/deprecated/gtkcombobox.c ++++ b/gtk/deprecated/gtkcombobox.c +@@ -366,7 +366,6 @@ gtk_combo_box_size_allocate (GtkWidget *widget, + { + GtkComboBox *combo_box = GTK_COMBO_BOX (widget); + GtkComboBoxPrivate *priv = gtk_combo_box_get_instance_private (combo_box); +- int menu_width; + + gtk_widget_size_allocate (priv->box, + &(GtkAllocation) { +@@ -374,17 +373,8 @@ gtk_combo_box_size_allocate (GtkWidget *widget, + width, height + }, baseline); + +- gtk_widget_set_size_request (priv->popup_widget, -1, -1); +- +- if (priv->popup_fixed_width) +- gtk_widget_measure (priv->popup_widget, GTK_ORIENTATION_HORIZONTAL, -1, +- &menu_width, NULL, NULL, NULL); +- else +- gtk_widget_measure (priv->popup_widget, GTK_ORIENTATION_HORIZONTAL, -1, +- NULL, &menu_width, NULL, NULL); +- +- gtk_widget_set_size_request (priv->popup_widget, +- MAX (width, menu_width), -1); ++ gtk_widget_set_size_request (priv->popup_widget, width, -1); ++ gtk_widget_queue_resize (priv->popup_widget); + + gtk_popover_present (GTK_POPOVER (priv->popup_widget)); + } diff --git a/debian/patches/debian/Disable-clipboard-test.patch b/debian/patches/debian/Disable-clipboard-test.patch index c7b7fe26ce..2ed09f5322 100644 --- a/debian/patches/debian/Disable-clipboard-test.patch +++ b/debian/patches/debian/Disable-clipboard-test.patch @@ -12,7 +12,7 @@ Forwarded: no 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build -index 3236ce7..45c4744 100644 +index 98b57cb..71f955f 100644 --- a/testsuite/gdk/meson.build +++ b/testsuite/gdk/meson.build @@ -12,7 +12,9 @@ clipboard_client = executable('clipboard-client', diff --git a/debian/patches/debian/Disable-inscription-markup.ui-reftest.patch b/debian/patches/debian/Disable-inscription-markup.ui-reftest.patch index f87e1c425a..855565cc8c 100644 --- a/debian/patches/debian/Disable-inscription-markup.ui-reftest.patch +++ b/debian/patches/debian/Disable-inscription-markup.ui-reftest.patch @@ -12,10 +12,10 @@ Forwarded: not-needed, workaround 1 file changed, 2 insertions(+) diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build -index b8e0ef0..e2ef9c2 100644 +index 1cc8a43..47d0864 100644 --- a/testsuite/reftests/meson.build +++ b/testsuite/reftests/meson.build -@@ -613,6 +613,8 @@ flaky = [ +@@ -616,6 +616,8 @@ flaky = [ 'shorthand-entry-border.ui', # blinking cursors and timing issues make this unreliable 'fixed-widget-stacking.ui', diff --git a/debian/patches/series b/debian/patches/series index a6870d4524..5725279277 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ debian/reftest_compare_surfaces-Report-how-much-the-images-diffe.patch debian/reftests-Allow-minor-differences-to-be-tolerated.patch debian/Disable-inscription-markup.ui-reftest.patch debian/Disable-clipboard-test.patch +combobox-Avoid-extra-queue_resize.patch -- 2.30.2